// 器部件常量
// "1": "企业",
// "2": "电站",
// "3": "变压器",
// "8": "关口表",
// "13": "环网柜",
// "14": "并网柜",
// "9": "并网表",
// "4": "电池堆",
// "5": "电池簇",
// "7": "电芯",
// "15": "负载",
// "11": "储能总计量关口表(总需量总防逆流)",
// "12": "断路器",
// "17": "储充",
// "19": "海博集装箱",
// "20": "支路关口表1",
// "21": "支路关口表2",
// "22": "支路关口表3",
export const EQUIP_TYPE = {
  BIAN_YA_QI: 3,  // 变压器
  HUAN_WANG_GUI: 13,  // 环网柜
  BING_WANG_GUI: 14,  // 并网柜
  DIAN_CHI_DUI: 4,  // 电池堆
  DIAN_CHI_CU: 5,  // 电池簇
  DIAN_XIN: 7,  // 电芯
  FU_ZAI: 15,  // 负载
  DUAN_LU_QI: 12,  // 断路器
  GUAN_KOU_BIAO: 8,  // 关口表
  BING_WANG_BIAO: 9,  // 并网表
  CHU_NENG_GUAN_KOU_BIAO: 11,  // 储能关口表
  CHONG_DIAN_ZHUANG: 17, // 储充项目 充电桩
  JI_ZHUANG_XIANG: 19, // 集装箱项目
  BATTERY_CLUSTER: 'BATTERY_CLUSTER', // 集装箱项目电池簇
  COMMON: 'COMMON',  // 通用(无需右侧配置)
  LINE: 0,  // 线路
}
export const COMMON_TYPE = [EQUIP_TYPE.COMMON, EQUIP_TYPE.JI_LIANG_DIAN_BIAO, EQUIP_TYPE.GUAN_KOU_BIAO, EQUIP_TYPE.BING_WANG_BIAO, EQUIP_TYPE.CHU_NENG_GUAN_KOU_BIAO];
export const CHILD_EQUIP_KEYS = ['isGatewayMeter', 'isBreaker', 'isRingMainMeter', 'isAccountMeter'];
export const CHILD_EQUIP = {
  isGatewayMeter: {
    name: '关口表',
    nameKey: 'gatewayName',
    url: 'https://ngp-cloud.oss-cn-shenzhen.aliyuncs.com/public/monitor/device_icon/meter_gateway.png',
    type: EQUIP_TYPE.GUAN_KOU_BIAO,
  },
  isBreaker: {
    name: '断路器',
    nameKey: 'breakerName',
    url: 'https://ngp-cloud.oss-cn-shenzhen.aliyuncs.com/public/monitor/device_icon/duanLuQi.png',
    type: EQUIP_TYPE.DUAN_LU_QI,
  },
  isRingMainMeter: {
    name: '并网表',
    nameKey: 'ringMeterName',
    url: 'https://ngp-cloud.oss-cn-shenzhen.aliyuncs.com/public/monitor/device_icon/meter_gateway.png',
    type: EQUIP_TYPE.BING_WANG_BIAO,
  },
  isAccountMeter: {
    name: '结算电表',
    nameKey: 'accountMeterName',
    url: 'https://ngp-cloud.oss-cn-shenzhen.aliyuncs.com/public/monitor/device_icon/meter_gateway.png',
    type: EQUIP_TYPE.JI_LIANG_DIAN_BIAO,
  },
}
export const BUSINESS_TYPE = {
  0: '储能',
  1: '充电',
  2: '光储充',
}
export const BUSINESS_TYPE_LIST = [
  {
    label: BUSINESS_TYPE[0],
    value: 0,
  },
  {
    label: BUSINESS_TYPE[1],
    value: 1,
  },
  {
    label: BUSINESS_TYPE[2],
    value: 2,
  }
]
export const MODEL_STATUS_LIST = [
  {
    label: '未启用',
    value: 0,
  },
  {
    label: '已启用',
    value: 1,
  },
  {
    label: '已停用',
    value: 2,
  }
]
export const MODEL_PARAMS_STATUS_LIST = [
  {
    label: '停用',
    value: 0,
  },
  {
    label: '启用',
    value: 1,
  }
]

// 参数类别
export const PARAM_TYPE = [
  {
    label: '采集',
    value: 1,
  },
  {
    label: '计算',
    value: 2,
  },
  {
    label: '本地值',
    value: 3,
  }
]

// 数据类别
export const DATA_TYPE = [
  {
    label: 'String',
    value: 1,
  },
  {
    label: 'Integer',
    value: 2,
  },
  {
    label: 'Long',
    value: 3,
  },
  {
    label: 'BigDecimal',
    value: 4,
  },
  {
    label: 'Date',
    value: 5,
  }
]

// 存储类别
export const STORAGE_TYPE = [
  {
    label: '不存储',
    value: 0,
  },
  {
    label: '变化时存储',
    value: 1,
  },
  {
    label: '秒',
    value: 2,
  },
  {
    label: '分',
    value: 3,
  },
  {
    label: '时',
    value: 4,
  },
  {
    label: '日',
    value: 5,
  },
  {
    label: '月',
    value: 6,
  }
]

// 数据处理规则
export const DATA_RULE = [
  // 0-不做处理；1-递增[暂不实现]；2-过滤0值
  {
    label: '不做处理',
    value: 0,
  },
  {
    label: '递增',
    value: 1,
  },
  {
    label: '过滤0值',
    value: 2,
  }
]

// 告警规则
export const EVT_RULE = [
  {
    label: '不告警',
    value: 0,
  },
  {
    label: '刷新为真（On）时报警',
    value: 1,
  },
  {
    label: '值判断告警',
    value: 2,
  }
]

// 告警类别
export const EVT_TYPE = [
  {
    label: '其它',
    value: 0,
  },
  {
    label: '消防告警',
    value: 1,
  },
  {
    label: '温度告警',
    value: 2,
  },
  {
    label: '主机安全告警',
    value: 3,
  },
  {
    label: '储能系统运行状态及通讯信号告警',
    value: 4,
  },
  {
    label: '电池单体状态告警',
    value: 5,
  }
]

// 储能电站状态
export const ENERGY_STATION_STATUS = [
  // 0-非储能企业；1-待建设；2-建设中；3-运行中；4-停运
  {
    label: '非储能企业',
    value: 0,
  },
  {
    label: '待建设',
    value: 1,
  },
  {
    label: '建设中',
    value: 2,
  },
  {
    label: '运行中',
    value: 3,
  },
  {
    label: '停运',
    value: 4,
  }
]

export const EQUIP_API = {
  [EQUIP_TYPE.BIAN_YA_QI]: 'stationPcs',
  [EQUIP_TYPE.HUAN_WANG_GUI]: 'stationRingMainUnit',
  [EQUIP_TYPE.BING_WANG_GUI]: 'stationGridConnect',
  [EQUIP_TYPE.DIAN_CHI_DUI]: 'energyLink',
  [EQUIP_TYPE.DIAN_CHI_CU]: 'powerBlock',
  [EQUIP_TYPE.JI_LIANG_DIAN_BIAO]: 'stationDeviceComponent',
  [EQUIP_TYPE.CHONG_DIAN_ZHUANG]: 'chargingBlock',
  [EQUIP_TYPE.JI_ZHUANG_XIANG]: 'containerBlock',
  [EQUIP_TYPE.GUAN_KOU_BIAO]: 'stationDeviceComponent',
}
export const EQUIP_DETAILS_API = {
  [EQUIP_TYPE.BIAN_YA_QI]: 'stationPcsDetails',
  [EQUIP_TYPE.HUAN_WANG_GUI]: 'stationRingMainUnitDetails',
  [EQUIP_TYPE.BING_WANG_GUI]: 'stationGridConnectDetails',
  [EQUIP_TYPE.DIAN_CHI_DUI]: 'energyLinkDetails',
  [EQUIP_TYPE.DIAN_CHI_CU]: 'powerBlockDetails',
  [EQUIP_TYPE.JI_LIANG_DIAN_BIAO]: 'stationDeviceComponentDetails',
  [EQUIP_TYPE.CHONG_DIAN_ZHUANG]: 'chargingBlockDetails',
  [EQUIP_TYPE.JI_ZHUANG_XIANG]: 'containerDetails',
  [EQUIP_TYPE.GUAN_KOU_BIAO]: 'stationDeviceComponentDetails',
}

export const MENU_AUTH = {
  // 1：目录 2：菜单 3：按钮 4：数据权限
  directory: 1,
  menu: 2,
  button: 3,
  data: 4
}

export const RULE_TYPE_LIST = [
  {
    label: '自定义',
    value: 2,
  },
  {
    label: '告警点位',
    value: 1,
  }
]
//1新巨能一级（预警），2新巨能二级（报警），3新巨能三级（报警）
export const WARN_LEVEL = {
  1: '新巨能一级（预警）',
  2: '新巨能二级（告警）',
  3: '新巨能三级（报警）',
}
export const WARN_LEVEL_LIST = [
  {
    label: WARN_LEVEL[1],
    value: 1,
  },
  {
    label: WARN_LEVEL[2],
    value: 2,
  }
  ,
  {
    label: WARN_LEVEL[3],
    value: 3,
  }
]
//告警层级,1站级，2堆级，3簇级，4-PCS级，5-PACK级，6-电芯级，7空调，8变压器，9并网柜，10汇流柜，11环网柜，12液冷机，12高压线
export const WARN_EQUIP_LEVEL = {
  1: '站级',
  2: '堆级',
  3: '簇级',
  4: 'PCS级',
  5: 'PACK级',
  6: '电芯级',
  7: '空调',
  8: '变压器',
  9: '并网柜',
  10: '汇流柜',
  11: '环网柜',
  12: '液冷机',
  13: '高压线',
}
export const WARN_EQUIP_LEVEL_LIST = [
  {
    label: WARN_EQUIP_LEVEL[1],
    value: 1,
  },
  {
    label: WARN_EQUIP_LEVEL[2],
    value: 2,
  },
  {
    label: WARN_EQUIP_LEVEL[3],
    value: 3,
  },
  {
    label: WARN_EQUIP_LEVEL[4],
    value: 4,
  },
  {
    label: WARN_EQUIP_LEVEL[5],
    value: 5,
  },
  {
    label: WARN_EQUIP_LEVEL[6],
    value: 6,
  },
  {
    label: WARN_EQUIP_LEVEL[7],
    value: 7,
  },
  {
    label: WARN_EQUIP_LEVEL[8],
    value: 8,
  },
  {
    label: WARN_EQUIP_LEVEL[9],
    value: 9,
  },
  {
    label: WARN_EQUIP_LEVEL[10],
    value: 10,
  },
  {
    label: WARN_EQUIP_LEVEL[11],
    value: 11,
  },
  {
    label: WARN_EQUIP_LEVEL[12],
    value: 12,
  },
  {
    label: WARN_EQUIP_LEVEL[13],
    value: 13,
  },


]

export const RULE_STATUS = {
  0: '禁用',
  1: '启用',
}
export const RULE_STATUS_LIST = [
  {
    label: RULE_STATUS[0],
    value: 0,
  },
  {
    label: RULE_STATUS[1],
    value: 1,
  }
]
//
// 判断条件 0大于，1大于等于，2小于，3小于等于，4等于，5不等于
export const JUDGE_CONDITION = {
  0: '大于',
  1: '大于等于',
  2: '小于',
  3: '小于等于',
  4: '等于',
  5: '不等于',
}
export const JUDGE_CONDITION_LIST = [
  {
    label: JUDGE_CONDITION[0],
    value: 0,
  },
  {
    label: JUDGE_CONDITION[1],
    value: 1,
  },
  {
    label: JUDGE_CONDITION[2],
    value: 2,
  },
  {
    label: JUDGE_CONDITION[3],
    value: 3,
  },
  {
    label: JUDGE_CONDITION[4],
    value: 4,
  },
  {
    label: JUDGE_CONDITION[5],

  }
]

export const KEEP_MINUTE_LIST = [
  {
    label: '无（及时）',
    value: 0,
  },
  {
    label: '持续1分钟',
    value: 1,
  },
  {
    label: '持续3分钟',
    value: 3,
  },
  {
    label: '持续5分钟',
    value: 5,
  },
  {
    label: '持续10分钟',
    value: 10,
  },
  {
    label: '持续15分钟',
    value: 15,
  },
  {
    label: '持续30分钟',
    value: 30,
  },
]
export const SILENT_MINUTE_LIST = [
  {
    label: '无',
    value: 0,
  },
  {
    label: '1分钟',
    value: 1,
  },
  {
    label: '2分钟',
    value: 2,
  },
  {
    label: '3分钟',
    value: 3,
  },
  {
    label: '5分钟',
    value: 5,
  },
  {
    label: '10分钟',
    value: 10,
  },
  {
    label: '15分钟',
    value: 15,
  },
  {
    label: '30分钟',
    value: 30,
  },
  {
    label: '45分钟',
    value: 45,
  },
  {
    label: '1小时',
    value: 60,
  },
  {
    label: '2小时',
    value: 120,
  },
  {
    label: '3小时',
    value: 180,
  },
  {
    label: '6小时',
    value: 360,
  },
  {
    label: '9小时',
    value: 540,
  },
  {
    label: '12小时',
    value: 720,
  },
  {
    label: '24小时',
    value: 1440,
  },

]
export const EFFECT_TIME_LIST = [
  {
    label: '全天',
    value: 1,
  },
  {
    label: '设定时段',
    value: 2,
  },


]
export const IS_AUTO_WORK_ORDER_LIST = [
  {
    label: '不生成',
    value: 0,
  },
  {
    label: '生成',
    value: 1,
  },

]
export const WARN_STATUS_NAME = [
  {
    label: '主机安全报警',
    value: 2,
  },
  {
    label: '通讯异常',
    value: 3,
  },
]

export const SECURITY_ALARMS = [
  {
    label: '消防报警',
    value: 1,
  },
  {
    label: '跳闸报警',
    value: 2,
  },
  {
    label: '柜门打开',
    value: 3,
  },
  {
    label: '急停告警',
    value: 4,
  },
  {
    label: '水浸告警',
    value: 5,
  },
]
export const COMMUNICATION_ALARMS = [
  {
    label: '电表通讯',
    value: 6,
  },
  {
    label: 'CCU通讯',
    value: 7,
  },
  {
    label: '调度网关通讯',
    value: 8,
  },
  {
    label: '摄像头通讯',
    value: 9,
  },
  {
    label: '簇通讯',
    value: 10,
  },
  {
    label: 'PCS通讯通讯',
    value: 11,
  },
]
export const ONLINE_STATUS = [
  {
    label: '离线',
    value: 0,
  },
  {
    label: '在线',
    value: 1,
  },
]
export const OFFLINE_TYPE = [
  {
    label: '电池堆',
    value: 1,
  },
  {
    label: '结算电表',
    value: 2,
  },
  {
    label: '摄像头',
    value: 3,
  }
]


export const WARN_CONFIRM_STATUS = [
  {
    label: '未确认',
    value: 0,
  },
  {
    label: '确认',
    value: 1,
  },

]

export const ALARM_POINT = {
  0: '非告警',
  1: '告警点位',
  2: '自定义'
}

export const MONITOR_TAB_ENUM = {
  Running: '1',
  Equip: '2',
  Error: '3',
  Monitoring: '4',
  Strategy: '5',
}
export const ERROR_TAB_ENUM = {
  RealWarning: '1',
  WorkOrder: '2'
}
export const MONITOR_TAB_LIST = [
  { value: MONITOR_TAB_ENUM.Running, label: "运行监测", permission: 'Running' },
  { value: MONITOR_TAB_ENUM.Equip, label: "设备监测", permission: 'Equip' },
  { value: MONITOR_TAB_ENUM.Strategy, label: "运行策略", permission: 'Strategy' },
  { value: MONITOR_TAB_ENUM.Error, label: "故障监控", permission: 'Error' },
  { value: MONITOR_TAB_ENUM.Monitoring, label: "实时监控", permission: 'Monitoring' }
];

export const ELECTRON_STATUS_ENUM = {
  // 0-未知 1-空闲；2-充电；3-放电
  unknown: '0',
  free: '1',
  charge: '2',
  discharge: '3',
}
export const ELECTRON_STATUS_LIST = {
  [ELECTRON_STATUS_ENUM.unknown]: '未知',
  [ELECTRON_STATUS_ENUM.charge]: '充电',
  [ELECTRON_STATUS_ENUM.discharge]: '放电',
  [ELECTRON_STATUS_ENUM.free]: '待机',
}

// 储充 充电枪状态
export const CHARGING_STATUS_ENUM = {
  // 0 空闲   2 充电
  free: '0',
  charge: '2',
}
export const CHARGING_STATUS_LIST = {
  [CHARGING_STATUS_ENUM.free]: '空闲',
  [CHARGING_STATUS_ENUM.charge]: '充电',
}

// 投资方列表
export const INVESTORS_LIST = [
  {
    value: 1,
    label: '新巨能'
  },
  {
    value: 2,
    label: '长电广东'
  },
  {
    value: 3,
    label: '长电上海'
  },
  {
    value: 4,
    label: '用户自投'
  },
  {
    value: 5,
    label: '西电'
  }
]